package cn.ssm.service.impl;

import cn.ssm.mappers.UserMapper;
import cn.ssm.pojo.User;
import cn.ssm.service.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public User login(String username, String password) {
        return userMapper.login(username,password);
    }

    @Override
    public List<User> getUsers(User user) {
        return userMapper.getUsers(user);
    }

    @Override
    public User getUserByBid(Integer id) {
        return userMapper.getUserByBid(id);
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public int deteleUserByBid(Integer id) {
        return userMapper.deteleUserByBid(id);
    }

    @Override
    public int updatemm(@Param("username") String username,@Param("password") String password) {
        return userMapper.updatemm(username,password);
    }

    @Override
    public User mm(String password) {
        return userMapper.mm(password);
    }

    @Override
    public User selectmm(String username) {
        return userMapper.selectmm(username);
    }

    @Override
    public int addzc(String username, String pwd) {
        return userMapper.addzc(username,pwd);
    }


}
